﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/MasterPage.master" AutoEventWireup="true" CodeFile="PurviewsList.aspx.cs" Inherits="PurviewManage_PurviewsList" Title="权限列表" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    
       <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div class="title">
                <asp:Label ID="lblTitle" runat="server" Text="权限列表"></asp:Label></div>
           <%-- <div class="list_title">
                系统当前共有<asp:Label ID="lblTotalPurview" runat="server"></asp:Label>
                个权限</div>--%>
            <table class="add_table" cellspacing="1" cellpadding="3">
                <tr>
                    <td align="right">
                        <asp:Label ID="lblPurviewName" runat="server" Text="权限名："></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtPurviewName" runat="server"></asp:TextBox>
                    </td>
                    <td align="right">
                        <asp:Label ID="lblPurviewGroupCode" runat="server" Text="权限分组号："></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtPurviewGroup" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>                   
                    <td colspan="4" align="center">
                        <asp:Button ID="btnSearch" runat="server" CssClass="btn" Text="搜索" OnClick="btnSearch_Click" />
                    </td>
                </tr>
            </table>
           
            <div id="divEntrust" runat="server">
                <div class="list_title">
                    <div class="autoleft">
                        <asp:Label ID="lblSelectOut" runat="server" Text="检索出"></asp:Label><asp:Label ID="lblTotal" runat="server"></asp:Label>
                        <asp:Label ID="lblSelectOut2" runat="server" Text="个权限"></asp:Label></div>
                    <div class="autoright">                       
                        每页显示：
                        <asp:DropDownList ID="ddlPages" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlPages_SelectedIndexChanged">
                            <asp:ListItem Selected="True" Text="10" Value="10"></asp:ListItem>
                            <asp:ListItem Text="15" Value="15"></asp:ListItem>
                        </asp:DropDownList>
                    </div>
                </div>
                <asp:GridView ID="gvPurview" runat="server" AllowPaging="True" PageSize="10"
                    AutoGenerateColumns="false" Width="100%"  AllowSorting="true" 
                    PagerSettings-Mode="NumericFirstLast" 
                    onpageindexchanging="gvPurview_PageIndexChanging" 
                    onrowcommand="gvPurview_RowCommand" onsorting="gvPurview_Sorting">
                    <PagerTemplate>
                        <table style="width: 100%">
                            <tr>
                                <td>
                                    <asp:Label ID="lblPerPage" runat="server" Text="页次"></asp:Label>:&nbsp;<asp:Label ID="Label1" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageIndex+1      %>'></asp:Label>/<asp:Label
                                        ID="Label2" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageCount %>'></asp:Label><asp:Label ID="lblPage" runat="server" Text="页"></asp:Label>&nbsp;
                                    <asp:Label ID="lblTotalPages" runat="server" Text="总计"></asp:Label>:&nbsp;<asp:Label ID="Label3" runat="server" Text="<%# ((System.Data.DataView)gvPurview.DataSource).Count %>"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Page" CommandArgument="First"
                                        Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=0 %>" Text="首页"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument="Prev" CommandName="Page"
                                        Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=0 %>" Text="前页"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton3" runat="server" CommandName="Page" CommandArgument="Next"
                                        Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=((GridView)Container.Parent.Parent).PageCount-1 %>" Text="后页"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton4" runat="server" CommandArgument="Last" CommandName="Page"
                                        Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=((GridView)Container.Parent.Parent).PageCount-1 %>" Text="尾页"></asp:LinkButton>&nbsp;
                                    <asp:Label ID="lblTurnOn" runat="server" Text="转第"></asp:Label><%--<asp:DropDownList ID="ddlGotoPage" AutoPostBack="true" runat="server" OnSelectedIndexChanged="GoPage_TextChanged"
                                        SelectedValue="<%# ((GridView)Container.Parent.Parent).PageIndex+1 %>" DataSource="<%# CreatSource(1,((GridView)Container.Parent.Parent).PageCount) %>">
                                    </asp:DropDownList>--%>
                                    <asp:TextBox ID="txtPages" runat="server" Width="35px"></asp:TextBox>
                                    <asp:Label ID="lblPages2" runat="server" Text="页"></asp:Label>
                                    <asp:LinkButton ID="lbtnGo" runat="server" Text="提交" onclick="lbtnGo_Click"></asp:LinkButton>
                                </td>
                            </tr>
                        </table>
                    </PagerTemplate>
                    <Columns>
                        <asp:TemplateField HeaderText="权限名" SortExpression="PurviewName">
                            <ItemTemplate>
                                <asp:Label ID="lblPurviewName" runat="server" Text='<%# Eval("PurviewName")%>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="权限码" SortExpression="PurviewCode">
                            <ItemTemplate>
                                <asp:Label ID="lblPurviewCode" runat="server" Text='<%# Eval("PurviewCode")%>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="权限组名称" SortExpression="PurviewGroupName">
                            <ItemTemplate>
                                <asp:Label ID="lblPurviewGroupName" runat="server" Text='<%# Eval("PurviewGroupName")%>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>                       
                        <asp:TemplateField HeaderText="权限分组码" SortExpression="PurviewGroupCode">
                            <ItemTemplate>
                                <asp:Label ID="lblPurviewGroupCode" runat="server" Text='<%# Eval("PurviewGroupCode")%>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>                       
                    </Columns>
                    <HeaderStyle HorizontalAlign="Center" />
                    <PagerSettings Mode="NumericFirstLast" />
                    <RowStyle HorizontalAlign="Center" />
                </asp:GridView>
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>

